import request from '@/utils/http'

const apiList = {
    category: 'articleCategory/findAll',
    addCategory: 'articleCategory/save',
    updateCategory: 'articleCategory/update',
    addContent: 'article/save',
    content: 'article/list',
    updateContent: 'article/update'
}

export default {
    category: data => {
        return request.get(apiList.category, { params: data })
    },
    addCategory: data => {
        return request.post(apiList.addCategory, data)
    },
    deleteCategory: data => {
        return request.delete(`articleCategory/delete/${data.id}`)
    },
    updateCategory: data => {
        return request.post(apiList.updateCategory, data)
    },
    addContent: data => {
        return request.post(apiList.addContent, data)
    },
    content: data => {
        return request.post(apiList.content, data)
    },
    deleteContent: data => {
        return request.delete(`article/delete/${data.articleId}`)
    },
    updateContent: data => {
        return request.post(apiList.updateContent, data)
    },
}